-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add article count copy editor field #547
Conversation
import { useForm } from 'react-hook-form'; | ||
|
||
interface FormData { | ||
copy: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you clear the contents of this field does the tool submit an empty string (rather than null) to the database? I'm wondering what then happens in the epic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good question, yes it does. But the epic logic checks that it contains "%%ARTICLE_COUNT%%" anyway, though arguably we shouldn't rely on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense. Perhaps it's worth being defensive and transforming ''
to undefined
in this component?
@@ -18,6 +24,20 @@ const VariantEditorSeparateArticleCountEditor: React.FC<VariantEditorSeparateArt | |||
updateSeparateArticleCount(Boolean(separateArticleCount) ? undefined : { type: 'above' }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the way this worked before means that the copy will be lost if "Above" is set to false, which I guess is fine?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great!
What does this change?
Adds the "copy" property to Epic test models (already exists here) and creates an editor field for it.
How to test
Edit a variant of an epic test - update the "Article count copy" under "Separate article count". Preview and see this copy. Save, reload and see the copy is still there.
How can we measure success?
Have we considered potential risks?
Images
Accessibility